<!--继承模板-->
{% extends 'layout.html' %}

<!--重写模块-->
{% block main%}
<ol class="breadcrumb">
    <li><a href="/admin">管理首页</a></li>
    <li><span>博文修改</span></a></li>
</ol>
<h3>博文内容修改 -{{ content.title}}</h3>
<form method="post">
    <div class="form-group">
        <label for="title">分类:</label>
        {{content.category.name}}
        <select name="category" id="category" class="form-control">
            <!--<option value="">1</option>
            <option value="">2</option>
            <option value="">3</option>-->
        {% for categary in categories %}
            {% if content.category._id.toString()==categary.id.toString() %}
                <option value="{{categary.id}}" selected>{{categary.name}}</option>
            {% else %}
                <option value="{{categary.id}}">{{categary.name}}</option>
            {% endif %}
        {% endfor %}
        </select>
    </div>

    <div class="form-group">
        <label for="title">博文标题:</label>
        <input type="text" class="form-control" id="title" placeholder="请输入博文标题" name="title" value="{{content.title}}">
    </div>

    <div class="form-group">
        <label for="description">博文简介:</label>
        <textarea name="description"  class="form-control" rows="6" id="description" placeholder="请输入内容简介">{{content.description}}</textarea>
    </div>

    <div class="form-group">
        <label for="content">博文内容:</label>
        <textarea name="content"  class="form-control" rows="10" id="content" placeholder="请输入内容">{{content.content}}</textarea>
    </div>

    <button type="submit" class="btn btn-default">提交</button>
</form>
{% endblock %}